package com.iweb.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author iweb002
 * @WebServlet :请求的路径   http://127.0.0.1:8090/hello
 */
@WebServlet(value = "/hello")
public class HelloServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 我要执行的业务：比如说调用JDBC
        System.out.println("hello servlet");

        // 跳转页面
        req.getRequestDispatcher("/main.html").forward(req,resp);
    }

}
